<script src="{$this->data['baseurl']}js/multiselect.js"></script>
<script src="{$this->data['baseurl']}js/category.js?{rand(0,10000)}"></script>
<script type="text/javascript">
var category_id	= {if $this->data['category']}{$this->data['category']['id']}{else}0{/if};
var successFun=function(res){
if(res.code==200){
	document.location	= res.data.forward;
}else{
	alert('出错了，请重新尝试！');
}
}
$(document).ready(function() { 
	var updateOptions	= {dataType:'json',error:doError,success:doSuccess}
    $('#form').ajaxForm(updateOptions); 
    
    var multiSelect		= new MultiSelect('divCategorySelect','hd_category_id',dataMultiCategory,dataAllCategory);
	multiSelect.init();
	multiSelect.select(category_id);
}); 
</script>
<div id="content">
<form id="form" action="{url('Hotkey','SaveEdit')}" method="post">
<h3 class="title">{if $this->data['id']>0}修改{else}添加{/if}热词</h3>
<table class="admin-table">
	<tr>
		<td>
			所在类目：
		</td>
		<td>
		<span id="divCategorySelect"></span>
		<input name="category_id" id="hd_category_id" type="hidden" value="{if $this->data['category']}{$this->data['category']['id']}{else}0{/if}" /><span etype='error_info' class="error_info"id="category_id_info"></span>
		</td>
	</tr>
	<tr>
		<td>
			关 键 词：
		</td>
		<td>
			{if $this->data['id']>0}
			<input name="name" id="name" type="text" tabindex="1" {if $this->data['info']}value="{$this->data['info']['name']}"{/if} /><span etype='error_info' class="error_info"id="name_info"></span>
			{else}
			<textarea rows="10" cols="30" name="name" id="name"></textarea>
			<span etype='error_info' class="error_info"id="name_info">每行输入一个关键词</span>
			{/if}
		</td>
	</tr>
	<tr>
		<td>
			显示顺序：
		</td>
		<td>
			<input name="orderby" id="orderby" type="text" tabindex="2" {if $this->data['info']}value="{$this->data['info']['orderby']}"{/if} /><span etype='error_info' class="error_info"id="orderby_info">数字越大排在越前面</span>
		</td>
	</tr>
	<tr>
		<td>
		</td>
		<td>
			<input id="btnSave" type="submit" value="保存" />&nbsp;&nbsp;<input  type="button" value="返回" onclick="history.back()" />
			<input name="id" type="hidden" value="{$this->data['id']}" />
		</td>
	</tr>
</table>
</form>
</div>